package com.lvtongka.app.base

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.ViewGroup
import android.view.Window
import com.lvtongka.app.R

open class BaseDialog(ctx: Context) : Dialog(ctx) {
    init {
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        this.window!!.setBackgroundDrawableResource(R.mipmap.transparent_bg)
        val window = this.window
        var mLayoutParams = window!!.attributes
        mLayoutParams.alpha = 1f
        window!!.attributes = mLayoutParams
        if (mLayoutParams != null) {
            mLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT
            mLayoutParams.gravity = Gravity.CENTER
        }
    }

}